<%@ page import="com.zzq.util.Constants" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>用户登录</title>
    <link rel="stylesheet" href="/jsp/css/login.css"/>
</head>
<body>

<h2>${userSession.userName}</h2>
<%--登录功能--%>
<%
    Object userName = request.getSession().getAttribute(Constants.USER_SESSION);
    if (userName!=null){
        RequestDispatcher rd = request.getRequestDispatcher("main.jsp");
        rd.forward(request,response);
    }
%>

<form class="login" action="${pageContext.request.contextPath}/User/login"  name="actionForm" id="actionForm"  method="post" >
    <div align="center" class="info">${error}</div>
    <div align="center" class="login_box">
        <input type="text" class="input-text" id="userCode" name="userCode" placeholder="请输入用户名" required/>
    </div>
    <div align="center" class="login_box">
        <input type="password" id="userPassword" name="userPassword" placeholder="请输入密码" required/>
    </div>
    <div align="center" class="subBtn">
        <input type="submit" value="登录" href="javascript:void(0)"/>
        <input type="reset" value="重置"/>
    </div>
</form>
<form align="center" action="${pageContext.request.contextPath}/register" method="post" class="register">
    <input type="submit" value="   注册   " style="color: #03e9f4" >
</form>

</body>
</html>
